//
//  CHHomeViewCell.m
//  CarFile
//
//  Created by 陈浩 on 2017/3/30.
//  Copyright © 2017年 陈浩. All rights reserved.
//

#import "CHHomeViewCell.h"
@interface CHHomeViewCell ()


@property (nonatomic ,strong) UIImageView *iconImg;
@property (nonatomic ,strong) UILabel *titleLabel;
@end

@implementation CHHomeViewCell

-(instancetype)initWithFrame:(CGRect)frame{
    
    if (self = [super initWithFrame:frame]) {
        self.backgroundColor = [UIColor whiteColor];
        [self setUI];
    }
    return self;
    
}


-(void)setUI{
    
    self.iconImg = [[UIImageView alloc] initWithFrame:CGRectMake(15, (self.h - 49)/2, 49,  49)];
    
    [self.contentView addSubview:self.iconImg];
    
    self.numLabel = [[UILabel alloc] initWithFrame:CGRectMake(CGRectGetMaxX(self.iconImg.frame)+5, (self.h - 41)/2*ScaleY, self.bounds.size.width -CGRectGetMaxX(self.iconImg.frame)-5 ,21)];
    self.numLabel.textColor = [UIColor colorWithHexString:@"F2572E" alpha:1.0f];
//    self.numLabel.font = [UIFont fontWithName:@"Capsuula" size:60];
    self.numLabel.font =  [UIFont systemFontOfSize:20*ScaleX];
    [self addSubview:self.numLabel];

    self.titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(CGRectGetMaxX(self.iconImg.frame)+5, CGRectGetMaxY(self.numLabel.frame)+8 , self.bounds.size.width -CGRectGetMaxX(self.iconImg.frame)-5, 12)];
    self.titleLabel.font = Font(12);
    self.titleLabel.textColor = [UIColor colorWithHexString:@"333333" alpha:1.0f];
//    self.titleLabel.text = @"维修车辆";
    [self addSubview:self.titleLabel];
//    
//    
//    UIView *line = [[UIView alloc] init];
//    line.frame = CGRectMake(self.w-0.5,(self.h -35)/2,0.5,35);
//    line.backgroundColor = [UIColor colorWithRed:243/255 green:243/255 blue:243/255 alpha:0.2];
//    [self addSubview:line];
    
}

-(void)setImgName:(NSString *)imgName{
    
    
    _imgName = imgName;
    
    self.iconImg.image = [UIImage imageNamed:imgName];
  
    
    
}

-(void)setTitleName:(NSString *)titleName{
    _titleName = titleName;
    
    self.titleLabel.text = titleName;
    
}



@end
